package com.faxsun.api.wrapper.address;


import javax.servlet.http.HttpServletRequest;
import javax.xml.bind.annotation.XmlAccessorType;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.broadleafcommerce.profile.core.domain.Address;
import org.broadleafcommerce.profile.core.domain.CustomerAddress;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.xml.bind.annotation.XmlAccessType;


@Component("fsCustomerAddressWrapper")
@Scope("prototype")
@XmlRootElement(name = "fsCustomerAddress")
@XmlAccessorType(value = XmlAccessType.FIELD)
@XmlType(name="fsCustomerAddressResource")
public class CustomerAddressWrapper extends org.broadleafcommerce.core.web.api.wrapper.AddressWrapper {
	
	 
	public void wrapDetails(CustomerAddress model, HttpServletRequest request) {
		
		Address address = model.getAddress();
	    super.wrapDetails(address, request);
	    this.id = model.getId();
	}
	
	@Override
	public Address unwrap(HttpServletRequest request, ApplicationContext context) {
		Address address = super.unwrap(request, context);
	    return address;
	}
	
}
